<!DOCTYPE html>
<html>
  <head>
    <title></title>
  </head>
  <body>
    <h1>内科</h1>
    <div>改动文件</div>
    <p>内科文件</p>
  </body>
  <script>
    var ws = new WebSocket("ws://127.0.0.1:1234");
    ws.onopen = function () {
      var uid = "user1";
      ws.send(uid);
    };
    ws.onmessage = function (e) {
      //alert(e.data);
      console.log(e.data);
      console.log(JSON.parse(e.data));
      let msg = JSON.parse(e.data);

      alert("紧急通知\n\n科室：" + msg.dep + "\n\n地点：" + msg.address);
      //window.location.reload();
    };
  </script>
</html>
